from django.forms import ModelForm

from capabilities import formfield_callbacks

from bl_rb.models import Blurb

class BlurbForm(ModelForm):
    formfield_callback = formfield_callbacks.html5
    
    def __init__(self, *args, **kwargs):
        super(BlurbForm, self).__init__(*args, **kwargs)
        self.fields['slug'].widget.attrs['autofocus'] = 'autofocus'

    class Meta:
        model = Blurb
